package jmcnet.libcommun.utilit;

import jmcnet.libcommun.exception.TimeException;

public class TimeHHMMSS extends Time {
	public TimeHHMMSS(int hh, int mm, int ss) {
		super(hh, mm, ss, 0);
	}

	public TimeHHMMSS(int hh, int mm) {
		super(hh, mm, 0, 0);
	}

	public TimeHHMMSS(int hh) {
		super(hh, 0, 0, 0);
	}

	public TimeHHMMSS() {
		super(0, 0, 0, 0);
	}
	
	public TimeHHMMSS(Time t) {
		super(t.getHour(), t.getMinute(), t.getSecond(), 0);
	}

	@Override
	public String toString() {
		return timeToString(true, true, true, false);
	}

	public static TimeHHMMSS stringToTimeHHMMSS(String str, boolean hb,
			boolean mb, boolean sb) throws TimeException {
		if (str == null || str.length() <= 0)
			return null;
		Time t = Time.stringToTime(str, hb, mb, sb, false);
		return new TimeHHMMSS(t.getHour(), t.getMinute(), t.getSecond());
	}	
}
